
package com.gouaixin.bee.beeframework2.bean;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;


public class TEQUAN
{

//    "TEQUAN" :
//    {
//        "! id"                :  32,
//            "oldprice":"600",    //原价
//            "currentprice":"400",    //现价
//        “time”：“3”，//持续时间（月为单位）
//        “youhui”:"减100，实付300元"，//优惠信息描述
//    },

    public String id;
    public String oldprice;
    public String currentprice;
    public String time;
    public String youhui;


    public void  fromJson(JSONObject jsonObject)  throws JSONException
    {
        if(null == jsonObject){
            return ;
        }

        JSONArray subItemArray;

        this.id = jsonObject.optString("id");
        this.oldprice = jsonObject.optString("oldprice");
        this.currentprice = jsonObject.optString("currentprice");
        this.time = jsonObject.optString("time");
        this.youhui = jsonObject.optString("youhui");
        return ;
    }

    public JSONObject toJson() throws JSONException
    {
        JSONObject localItemObject = new JSONObject();
        JSONArray itemJSONArray = new JSONArray();
        localItemObject.put("id", id);
        localItemObject.put("oldprice", oldprice);
        localItemObject.put("currentprice", currentprice);
        localItemObject.put("time", time);
        localItemObject.put("youhui", youhui);
        return localItemObject;
    }

}
